Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move terraform modules from ./build to ./install #1167

Conversation

amitlevy21
Copy link
Contributor

Closes #1150.
@aLekSer Waiting for feedback on:

  • make terraform-init
  • make gcloud-terraform-cluster
  • make gcloud-terraform-install
  • make gcloud-terraform-destroy-cluster

Thanks!

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@amitlevy21
Copy link
Contributor Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@aLekSer
Copy link
Collaborator

aLekSer commented Nov 1, 2019

@amitlevy21 Please include also this file updated: ./build/includes/terraform.mk
These start of each target should point to proper directory, not build.

cd $(mount_path)/build && terraform apply -auto-approve -var values_file="" \

@amitlevy21 amitlevy21 force-pushed the move_terraform_modules_to_install_folder branch from 5e47ba1 to 49f1030 Compare November 1, 2019 15:10
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: eb19ae27-d4c2-473d-94fc-3c20e12664fe

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 6acfe9c2-f052-4b92-8013-511734a34ce6

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@aLekSer
Copy link
Collaborator

aLekSer commented Nov 1, 2019

I will verify that all is working as it should.
/assign alekser

@aLekSer
Copy link
Collaborator

aLekSer commented Nov 4, 2019

I performed git checkout <your commit-id> and get an error:

make gcloud-terraform-cluster
mkdir -p ~/.kube/
mkdir -p /Users/alexander.apalikov/go/src/agones.dev/agones/build//.gocache
mkdir -p /Users/alexander.apalikov/go/src/agones.dev/agones/build//.config/gcloud
mkdir -p ~/.helm
/Applications/Xcode.app/Contents/Developer/usr/bin/make ensure-image IMAGE_TAG=agones-build:418360257b BUILD_TARGET=build-build-image                                                                                                                                     
docker run --rm -v /Users/alexander/go/src/agones.dev/agones/build//.config/gcloud:/root/.config/gcloud -v ~/.kube/:/root/.kube -v ~/.helm:/root/.helm -v /Users/alexander/go/src/agones.dev/agones:/go/src/agones.dev/agones -v /Users/alexander/go/src/agones.dev/agones/build//.gomod:/go/pkg/mod -v /Users/alexander/go/src/agones.dev/agones/build//.gocache:/root/.cache/go-build -e "KUBECONFIG=/root/.kube/config" -e "GO111MODULE=on" -w /go/src/agones.dev/agones  agones-build:418360257b bash -c 'export TF_VAR_agones_version='' && \
                cd /go/src/agones.dev/agones/install/terraform && terraform apply -auto-approve -var values_file="" \
                -var chart="agones" \
                -var "cluster={name=\"test-cluster\", machineType=\"n1-standard-4\", \
                 zone=\"us-west1-c\", project=\"ag\", \
                 initialNodeCount=\"4\"}"'

Error: No configuration files

@aLekSer
Copy link
Collaborator

aLekSer commented Nov 4, 2019

Your forgot to move all *.tf files from build into ./install/terraform folder, like this one: https://github.com/googleforgames/agones/blob/master/build/cluster.tf

git mv ./*.tf ../install/terraform/
git commit --amend

We have a policy - one commit per Pull Request.

@aLekSer
Copy link
Collaborator

aLekSer commented Nov 4, 2019

I have created a commit which contains all updates necessary to conclude this PR:
69d00d3

@roberthbailey
Copy link
Member

I think this is going to break of terraform installation instructions.

The terraform module linked from here is https://github.com/googleforgames/agones/blob/release-1.1.0/examples/terraform-submodules/gke/module.tf

Even though that file is on the 1.1 release branch, it pulls from the build directory on the master branch: git::https://github.com/googleforgames/agones.git//build/?ref=master.

If we move files out of that directory on the master branch, then our terraform instructions for all previous releases will break.

If we want to move the files, we should copy them and leave them in the build directory as well (maybe a symlink would work?).

We should also consider updating the gke/module.tf file to reference the release branch so that the configs are all versioned together.

@amitlevy21 amitlevy21 force-pushed the move_terraform_modules_to_install_folder branch from 49f1030 to e1535e3 Compare November 5, 2019 15:26
@amitlevy21
Copy link
Contributor Author

amitlevy21 commented Nov 5, 2019

@aLekSer @roberthbailey Thanks for the help.
I have included the changes from 69d00d3 and created symlinks.

Regarding the reference to release branch in gke/module.tf, since release branches change frequently, how can I avoid hard coding a specific release branch? Is there a way to auto detect which release branch it should reference?

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 13e39d4f-0597-43cf-86fc-f9bdef20164e

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1167/head:pr_1167 && git checkout pr_1167
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.2.0-e1535e3

@roberthbailey
Copy link
Member

Regarding the reference to release branch in gke/module.tf, since release branches change frequently, how can I avoid hard coding a specific release branch? Is there a way to auto detect which release branch it should reference?

@markmandel ^^

As far as I know, we have two ways of doing this in the codebase.

Within the website, we have variable that get automatically substituted in for the release branch number but I don't think that magic happens outside of the website directory so unless I'm missing something you can't do something like {{% release-branch %}} in the code and have it automatically updated.

Elsewhere, we have hard-coded numbers, along with a checklist when creating a release to bump the numbers. This is generally within the install directory (e.g. for the helm chart version) and since terraform is about installing, it might make sense to move the module.tf into the install directory and update the release checklist to bump the version number each time we create a release.

@markmandel
Copy link
Member

markmandel commented Nov 5, 2019

Possible side thought on this - should the terraform install files also be included as a release artifact?

Would that solve this issue (maybe in the long term, rather than short)

@amitlevy21
Copy link
Contributor Author

@roberthbailey Rebased with #1179.
As part of the release process, I have updated docs/governance/templates/release_issue.md with another task in the checklist.

I was unsure if I should update git::https://github.com/googleforgames/agones.git//build/?ref=master to reference a release branch, as I don't know what release this PR will be included (1.2.0 I assume?)

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 30b047fe-b1d0-4abf-ad41-a766c6ba212e

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@roberthbailey
Copy link
Member

roberthbailey commented Nov 8, 2019

I was unsure if I should update git::https://github.com/googleforgames/agones.git//build/?ref=master to reference a release branch, as I don't know what release this PR will be included (1.2.0 I assume?)

Yes, it will be part of the 1.2 release.

Edit: It looks like our best bet is to leave this at the master branch for now and then during the 1.2 release we will update it to point to the release branch.

@amitlevy21 amitlevy21 force-pushed the move_terraform_modules_to_install_folder branch from a46e489 to 123ce6b Compare November 13, 2019 07:18
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: d2b503aa-ac37-417c-a2bc-17b4ea898929

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1167/head:pr_1167 && git checkout pr_1167
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.2.0-123ce6b

@amitlevy21
Copy link
Contributor Author

@aLekSer @roberthbailey Is there anything else needed here? Do I need to rebase again so the branch aligns with master?

@aLekSer
Copy link
Collaborator

aLekSer commented Nov 18, 2019

Yes, please update, other than that it looks good from my side.

@amitlevy21 amitlevy21 force-pushed the move_terraform_modules_to_install_folder branch from 123ce6b to b5f263a Compare November 18, 2019 10:04
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 3685f58a-14dc-4666-ab89-e013f4d62366

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1167/head:pr_1167 && git checkout pr_1167
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.2.0-b5f263a

@amitlevy21
Copy link
Contributor Author

Yes, please update, other than that it looks good from my side.

Done

@markmandel markmandel added area/operations Installation, updating, metrics etc kind/cleanup Refactoring code, fixing up documentation, etc labels Nov 20, 2019
@markmandel
Copy link
Member

Just confirming - this is good to approve and merge? if so, happy to hit the button.

@amitlevy21
Copy link
Contributor Author

May I ask, what's holding this?
@roberthbailey is this waiting for your approval?

@roberthbailey
Copy link
Member

I think it was waiting for a final lgtm from @aLekSer

@amitlevy21 amitlevy21 force-pushed the move_terraform_modules_to_install_folder branch from 2d5b0c0 to 5bddc30 Compare December 3, 2019 07:43
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: aab0f9ae-7add-40dd-af59-eddeff423e47

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1167/head:pr_1167 && git checkout pr_1167
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.2.0-2d5b0c0

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 0d7622b2-148f-4821-9fb2-dee86847294a

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1167/head:pr_1167 && git checkout pr_1167
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.2.0-5bddc30

@aLekSer
Copy link
Collaborator

aLekSer commented Dec 3, 2019

LGTM
This version was tested some time ago.

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amitlevy21, markmandel

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-robot
Copy link

New changes are detected. LGTM label has been removed.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 20cd5f0b-fe5e-4dce-b12f-a2757227a35d

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1167/head:pr_1167 && git checkout pr_1167
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.2.0-c79f503

@markmandel markmandel merged commit 9c7875f into googleforgames:master Dec 3, 2019
@markmandel markmandel added this to the 1.2.0 milestone Dec 3, 2019
@amitlevy21 amitlevy21 deleted the move_terraform_modules_to_install_folder branch December 4, 2019 06:49
ilkercelikyilmaz pushed a commit to ilkercelikyilmaz/agones that referenced this pull request Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/operations Installation, updating, metrics etc kind/cleanup Refactoring code, fixing up documentation, etc size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move terraform modules from ./build to ./install
7 participants